/**
 * 会员类
 */
class Member {
    private String cardNo;   // 会员卡号
    private String name;     // 会员姓名
    private String phone;    // 联系电话
    private int points;      // 会员积分
    private double balance;  // 会员卡余额

    public Member(String cardNo, String name, String phone, double initialBalance) {
        this.cardNo = cardNo;
        this.name = name;
        this.phone = phone;
        this.points = 0;
        this.balance = initialBalance;
    }

    // Getter和Setter方法
    public String getCardNo() { return cardNo; }
    public String getName() { return name; }
    public String getPhone() { return phone; }
    public int getPoints() { return points; }
    public double getBalance() { return balance; }

    public void addPoints(int points) {
        this.points += points;
    }

    public void addBalance(double amount) {
        this.balance += amount;
    }

    public boolean deductBalance(double amount) {
        if (balance >= amount) {
            balance -= amount;
            return true;
        }
        return false;
    }

    public void setName(String name) { this.name = name; }
    public void setPhone(String phone) { this.phone = phone; }
}